package com.zgjkhis.modules.enums;

import lombok.Getter;

@Getter
public enum OrderTypeEnum {
	/**
	 * @Author yzq
	 * @Description 本地处方
	 * @Date 2021/9/14 15:08
	 * @Param
	 * @return
	 **/
	LOCAL(1, "本地处方"),
	/**
	 * @Author yzq
	 * @Description 云享处方
	 * @Date 2021/9/14 15:08
	 * @Param
	 * @return
	 **/
	ONLINE(2, "云享处方"),




	;

	private final Integer code;

	private final String value;

	OrderTypeEnum(Integer code, String value) {
		this.code = code;
		this.value = value;
	}

	public static String findByCode(Integer code) {
		for (OrderTypeEnum drugTypeEnum : OrderTypeEnum.values()) {
			if (drugTypeEnum.getCode().equals(code)) {
				return drugTypeEnum.value;
			}
		}
		return "未知";
	}
	public static Integer findByValue(String value) {
		for (OrderTypeEnum drugTypeEnum : OrderTypeEnum.values()) {
			if (drugTypeEnum.getValue().equals(value)) {
				return drugTypeEnum.code;
			}
		}
		return null;
	}

}
